//
//  ZCInvolvedmubiaoCell.m
//  zctx
//
//  Created by apple on 15/12/28.
//  Copyright © 2015年 sanliang. All rights reserved.
//

#import "ZCInvolvedmubiaoCell.h"

@implementation ZCInvolvedmubiaoCell


+(instancetype)cellWithInvolvedmubiaoCell:(UITableView *)tableView{
    
    static NSString *IDcell = @"biaocell";
    ZCInvolvedmubiaoCell *cell = [tableView dequeueReusableCellWithIdentifier:IDcell];
    if (!cell) {
        cell = [[ZCInvolvedmubiaoCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:IDcell];
    }
    return cell;
}

- (void)awakeFromNib {
    // Initialization code
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    self.yichouMoneyLable.textColor = [UIColor colorWithHexString:@"#000000"];
    self.mibiaoMoneyLable.textColor = [UIColor colorWithHexString:@"#000000"];
    self.zhichiMoneyLable.textColor = [UIColor colorWithHexString:@"#000000"];
    self.chouLable.textColor = [UIColor colorWithHexString:@"#b2b2b2"];
    self.biaoLable.textColor = [UIColor colorWithHexString:@"#b2b2b2"];
    self.chiLable.textColor = [UIColor colorWithHexString:@"#b2b2b2"];
//    self.lineone.backgroundColor = [UIColor colorWithHexString:@"#f1f1f1"];
//    self.lineTwo.backgroundColor = [UIColor colorWithHexString:@"#b2b2b2"];
    
    self.lineone.backgroundColor = RGB(227, 227, 229);
    self.lineTwo.backgroundColor = RGB(227, 227, 229);
    self.weight.constant = (SCREEN_WIDTH-2)/3;
    self.twoweight.constant =(SCREEN_WIDTH-2)/3;
}

-(void)setDetailModel:(ZCInvolvedDetailsModelContent *)detailModel{
    _detailModel = detailModel;
    float priceStr = [[NSString stringWithFormat:@"%@",_detailModel.finish]floatValue]/100;
    float money = _detailModel.emoney/100;
    
    float moneyNum = priceStr/money;
    if (moneyNum>0 && moneyNum<0.01) {
        moneyNum = 0.01;
    }
    self.yichouMoneyLable.text = [NSString stringWithFormat:@"%.0f元",priceStr];
    self.mibiaoMoneyLable.text = [NSString stringWithFormat:@"%.0f元",money];
    self.zhichiMoneyLable.text =[NSString stringWithFormat:@"%ld人",[detailModel.sponsorsCount integerValue]];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
